package com.yong.automoguding.task;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Profile;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.scheduling.annotation.Schedules;
import org.springframework.stereotype.Component;



/**
 * 定时任务执行器
 * @author Hes
 */
@Slf4j
@Component
@Profile("prod")
public class ScheduledTaskRunner {



    @Autowired
    private MogudingClockTask task;

    @Autowired
    private CpDailyClockTask cpDailyClockTask;


    @Scheduled(cron = "0 0 8 * * ?")
    public void clock(){
        task.run();
    }


    @Schedules({
            @Scheduled(fixedDelay = 3600000L)
    })
    public void cpDaily(){
        cpDailyClockTask.run();
    }







}
